﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Hello Name</title>
    <script type="text/javascript">
        function displayNameAndDate() 
        {
            var firstName = document.mainForm.firstNameBox.value;
            var lastName = document.mainForm.lastNameBox.value;
            var name = firstName + ' ' + lastName;

            var now = new Date();

            var text = "Hello " + name + "\nIt is now " + now;
            alert(text);
        }
	</script>
</head>
<body>

    <form name="mainForm" action="" method="get">
		<br/>First name: <input type="text" name="firstNameBox" /> <br/>
		<br/>Last name: <input type="text" name="lastNameBox" /> <br/>
		<input type="button" value="Click me" onclick="javascript: displayNameAndDate()" />
	</form>

</body>
</html>
